<template>
    <div class="newsinfo_container">
        <h3 class="title">文章标题</h3>
        <p class="subtitle">
            <span>发表时间{{newsinfo.id}}</span>
            <span>发表次数：0次</span>
        </p>

        <hr>
        <div class="content">新闻内容</div>
    </div>
</template>
<script>
export default{
    data(){
        return {
                newsinfo:{}
        }
    },
    created(){
       this.getNewsInfo();
    },
    methods:{
        getNewsInfo(){
            this.$http.get('api/getProduct').then(result =>{
                if(result.body.status ===0){
                    this.newsinfo = result.body.message[0];
                    console.log(result.body)
                }else{
                    alert('123')
                }
            })
        }
    }
}
</script>
<style scoped>
.newsinfo_container{
    padding:0 4px;
}
.newsinfo_container h3{
    font-size: 16px;
    text-align: center;
    color:red;
}
.newsinfo_container .subtitle{
    font-size: 13px;
    color: #226aff;
    display: flex;
    justify-content: space-between;
}
</style>

